import request from '@/sheep/request';

export default {
    // 我的上级
	my_parent_listAPI: (params) =>
    request({
        url: '/api/user_agent/my_parent_list',
        method: 'GET',
        custom: {
            showLoading: true,
            loadingMsg: '加载中',
            showError: true,
            showSuccess: false,
            errorMsg: '',
            auth: true,
            successMsg: false,
        },
        params,
    }),

    // 任务列表
    scheduleListAPI: (params) =>
    request({
        url: '/api/schedule/getlist_by_departmentid',
        method: 'GET',
        custom: {
            showLoading: true,
            loadingMsg: '加载中',
            showError: true,
            showSuccess: false,
            errorMsg: '',
            auth: true,
            successMsg: false,
        },
        params,
    }),

    // 人员列表
    schedule_userListAPI: (params) =>
    request({
        url: '/api/schedule_user/getlist_by_scheduleid',
        method: 'GET',
        custom: {
            showLoading: true,
            loadingMsg: '加载中',
            showError: true,
            showSuccess: false,
            errorMsg: '',
            auth: true,
            successMsg: false,
        },
        params,
    }),

    // 我的代理
    my_children_listAPI: (params) =>
    request({
        url: '/api/user_agent/my_children_list',
        method: 'GET',
        custom: {
            showLoading: true,
            loadingMsg: '加载中',
            showError: true,
            showSuccess: false,
            errorMsg: '',
            auth: true,
            successMsg: false,
        },
        params,
    }),

    // 代理商邀请
    postuser_agentAddAPI: (params) =>
    request({
        url: '/api/user_agent/add',
        method: 'POST',
        params,
        custom: {
            showSuccess: false,
            successMsg: '',
            showError: true,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
        },
    }),

    // 解绑代理商
    postuser_agentDelAPI: (data) =>
    request({
        url: '/api/user_agent/del',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            successMsg: '',
            showError: true,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
        },
    }),

    // 获取公司部门
    departmentViewAPI: (params) =>
    request({
        url: '/api/department/view',
        method: 'POST',
        params,
        custom: {
            showSuccess: false,
            successMsg: '',
            showError: false,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
        },
    }),

      // 人员列表（员工端）
    getListByScheduleidGroupbyShare: (data) =>
    request({
        url: '/api/schedule_user/getlist_by_scheduleid_groupby_share',
        method: 'POST',
        data,
        custom: {
            showSuccess: false,
            successMsg: '',
            showError: true,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
        },
    }),
    // 代理商金额/加减班修改（代理商修改自己金额）
    editAgentByScheduleid:(params) => 
    request({
        url: '/api/user_agent_price/edit_agent_by_scheduleid',
        method: 'POST',
        custom: {
        showSuccess: false,
        successMsg: '',
        showError: false,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
        },
        params
    }),
}